<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set  var="ctx"  value="<%= request.getContextPath() %>" />
<c:set  var="js"   value="${ctx}/static/js"/>
<c:set  var="css"  value="${ctx}/static/css"/>
<c:set  var="img"  value="${ctx}/static/images"/>
<script>
ctx= '${ctx}';
$.ajaxSetup({
    contentType:"application/x-www-form-urlencoded;charset=utf-8",
    cache:false,
    dataType:"json",
    complete:function(XHR,TS){
       var resText=XHR.responseText;
       if(resText.indexOf("sessionState")!=-1 && resText.indexOf("loginUrl")!=-1){
	        var resJson=$.parseJSON(resText);
	        if(resJson.sessionState==0){
		        window.top.location.href=resJson.loginUrl;
		    }
       }
	 }
});

</script>

